Ext.ux.ViewFeedback = Ext.extend(Ext.Window, {
	idString:'',
	initComponent : function(config) {
		var linedata = Ext.getCmp(this.idString).getStore()
				.getAt(Ext.getCmp(this.idString).getSelectionModel().lastActive);
		
		var modifyForm = new Ext.FormPanel({
        	labelWidth : 100, // label settings here cascade unless overridden
			autoScroll:true,
			frame : true,
			region : 'center',
			border:true,
			fileUpload: true,
			bodyStyle : 'padding:5px 5px 0',
			width : '100%',
			defaults : {
				width : 220
			},
			defaultType : 'textfield',

			items : [{
				fieldLabel : '昵称',
				id:'feedbackNicknameView',
				editable:false,
				allowBlank : false
			},{
				fieldLabel : '邮箱',
				id:'feedbackEmailView',
				allowBlank : false
			},{
				fieldLabel : '电话',
				id:'feedbackPhoneView',
				allowBlank : false
			},{
				fieldLabel : '留言时间',
				id:'feedbackDateView',
				allowBlank : false
			},{
				anchor:'95%',
				fieldLabel : '内容',
				xtype:'textarea',
				id:'feedbackContentView',
				height:300,
				allowBlank : false,
				autoScroll:true
			}]
		});
		
		Ext.getCmp("feedbackNicknameView").setValue(linedata.json.nickname);
		Ext.getCmp("feedbackEmailView").setValue(linedata.json.email);
		Ext.getCmp("feedbackPhoneView").setValue(linedata.json.phone);
		Ext.getCmp("feedbackDateView").setValue(linedata.json.createDate);
		Ext.getCmp("feedbackContentView").setValue(linedata.json.content);
		
		Ext.apply(this, {
			title: "查看留言信息",
	        plain: true,
	        width:1000,
	        height:600,
	        modal: true,
	        maximizable:true,
	        border: false,
	        layout: 'border',
	        autoScroll:true,
	        items: [modifyForm]
		});
		Ext.ux.ViewFeedback.superclass.initComponent.apply(this, arguments);
	}
});
Ext.reg('lgnViewFeedback', Ext.ux.ViewFeedback);
